package org.doubango.imsdroid.Services.strategy.show;

import org.doubango.imsdroid.Engine;
import org.doubango.imsdroid.Main;
import org.doubango.imsdroid.Services.Impl.ScreenService;

import android.app.Activity;
import android.util.Log;

public class Show1 implements IShowStrategy{
	private final static String TAG = ScreenService.class.getCanonicalName();
	
	@Override
	public boolean show(Class<? extends Activity> cls, String id) {
		final  Activity screen = (Activity)((Main)Engine.getInstance().getMainActivity()).getLocalActivityManager().getActivity(id);
		if (screen == null) {
			Log.e(TAG, String.format(
					"Failed to retrieve the Screen with id=%s", id));
			return false;
		} else {
			return this.show(screen.getClass(), id);
		}
	}
}
